# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-guess-language
pkgname=('python2-guess-language' 'python-guess-language')
_pkgname=guess-language
pkgver=0.2
pkgrel=11
pkgdesc='Attempts to determine the natural language of a selection of Unicode (utf-8) text.'
arch=('any')
url='https://pypi.python.org/pypi/guess-language'
license=('LGPL')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('0badf3566d01ddac1c0da10cfd649515ed2b2e9b059fce32114a7dbcac91c0aa12c6da803181c21e6cc745bb8725885da1f2f4ee0738bc5230d6d5e567eecb10')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-guess-language() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-guess-language() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

